package com.ruoyi.receipt.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.receipt.domain.TbExampleSubjectRelation;
import com.ruoyi.receipt.utils.UserInitUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.receipt.mapper.TbExampleSubjectAnalysisMapper;
import com.ruoyi.receipt.domain.TbExampleSubjectAnalysis;
import com.ruoyi.receipt.service.ITbExampleSubjectAnalysisService;

/**
 * 例题解析Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-04-01
 */
@Service
public class TbExampleSubjectAnalysisServiceImpl implements ITbExampleSubjectAnalysisService 
{
    @Autowired
    private TbExampleSubjectAnalysisMapper tbExampleSubjectAnalysisMapper;

    /**
     * 查询例题解析
     * 
     * @param id 例题解析ID
     * @return 例题解析
     */
    @Override
    public TbExampleSubjectAnalysis selectTbExampleSubjectAnalysisById(Long id)
    {
        return tbExampleSubjectAnalysisMapper.selectTbExampleSubjectAnalysisById(id);
    }

    /**
     * 查询例题解析列表
     * 
     * @param tbExampleSubjectAnalysis 例题解析
     * @return 例题解析
     */
    @Override
    @DataScope(deptAlias = "da",userAlias = "createId")
    public List<TbExampleSubjectAnalysis> selectTbExampleSubjectAnalysisList(TbExampleSubjectAnalysis tbExampleSubjectAnalysis)
    {
        return tbExampleSubjectAnalysisMapper.selectTbExampleSubjectAnalysisList(tbExampleSubjectAnalysis);
    }

    /**
     * 新增例题解析
     * 
     * @param tbExampleSubjectAnalysis 例题解析
     * @return 结果
     */
    @Override
    public int insertTbExampleSubjectAnalysis(TbExampleSubjectAnalysis tbExampleSubjectAnalysis)
    {
        tbExampleSubjectAnalysis.setCreateTime(DateUtils.getNowDate());
        UserInitUtils.initUserInfo(tbExampleSubjectAnalysis);
        return tbExampleSubjectAnalysisMapper.insertTbExampleSubjectAnalysis(tbExampleSubjectAnalysis);
    }

    /**
     * 修改例题解析
     * 
     * @param tbExampleSubjectAnalysis 例题解析
     * @return 结果
     */
    @Override
    public int updateTbExampleSubjectAnalysis(TbExampleSubjectAnalysis tbExampleSubjectAnalysis)
    {
        tbExampleSubjectAnalysis.setUpdateTime(DateUtils.getNowDate());
        UserInitUtils.initUserInfoForUpdate(tbExampleSubjectAnalysis);
        return tbExampleSubjectAnalysisMapper.updateTbExampleSubjectAnalysis(tbExampleSubjectAnalysis);
    }

    /**
     * 批量删除例题解析
     * 
     * @param ids 需要删除的例题解析ID
     * @return 结果
     */
    @Override
    public int deleteTbExampleSubjectAnalysisByIds(Long[] ids)
    {
        return tbExampleSubjectAnalysisMapper.deleteTbExampleSubjectAnalysisByIds(ids);
    }

    /**
     * 删除例题解析信息
     * 
     * @param id 例题解析ID
     * @return 结果
     */
    @Override
    public int deleteTbExampleSubjectAnalysisById(Long id)
    {
        return tbExampleSubjectAnalysisMapper.deleteTbExampleSubjectAnalysisById(id);
    }

    @Override
    public List<TbExampleSubjectAnalysis> selcetanalysis(Long knowledgeManagerRelated) {
        return tbExampleSubjectAnalysisMapper.selcetanalysis(knowledgeManagerRelated);
    }
    @Override
    public List selectAnalysisOut(TbExampleSubjectAnalysis tbExampleSubjectAnalysis) {
        return tbExampleSubjectAnalysisMapper.selectAnalysisOut(tbExampleSubjectAnalysis);
    }

    @Override
    public int updateAnalysisDel(Long subjectManagerId) {
        return tbExampleSubjectAnalysisMapper.updateAnalysisDel(subjectManagerId);
    }
}
